import { CartItemType, PayInfoGoodType, SkuGoodInterface } from "./good";
import { UserAddressType } from "./user";

// 订单商品类型
interface OrderItemType extends CartItemType {
    payPrice: string,
    totalPrice: string,
    totalPayPrice: string,
};

// 订单总结信息
interface OrderSummaryType {
    goodsCount: number,
    totalPrice: number,
    totalPayPrice: number,
    postFee: number,
    discountPrice: number,
};

// 预生成订单信息
export type PreOrderType = {
    userAddresses: Array<UserAddressType>,
    goods: Array<OrderItemType>,
    summary: OrderSummaryType,
};

// 生成订单请求数据类型
export type CreateOrderRequestType = {
    deliveryTimeType: number,
    payType: number,
    payChannel: number,
    buyerMessage: string,
    goods: Array<SkuGoodInterface>,
    addressId: string,
};

// 订单类型
export interface OrderType {
    id: string,
    createTime: string,
    payType: number,
    orderState: number,
    payLatestTime: string,
    postFee: number,
    payMoney: number,
    totalMoney: number,
    totalNum: number,
    payChannel: number,
};

// 支付信息类型
export interface PayInfoType extends OrderType {
    countdown: number,
    payState: number,
    deliveryTimeType: number,
    receiverContact: string,
    receiverMobile: string,
    provinceCode: string,
    cityCode: string,
    countyCode: string,
    receiverAddress: string,
    payTime: null,
    consignTime: null,
    endTime: null,
    closeTime: string,
    evaluationTime: null,
    skus: Array<PayInfoGoodType>,
    arrivalEstimatedTime: null,
};